In computer systems, a network stack is a logical separation of physical and software components into layers of networking functionality. Each layer in the network stack builds on functionality of the layer immediately beneath it, if one exists. Thus, each layer effectively provides a level of abstraction, whereby different implementations of each layer may be interchanged so long as the interfaces between the layers remain compatible.
Many different network stack models exist, and the same network configuration may be described using different network stack models. The Open Systems Interconnection (OSI) Reference Model is one example of a network stack model, and Transmission Control Protocol/Internet Protocol (TCP/IP) model is another example. The TCP/IP model is most commonly used to describe Internet-related networking functionality, although it may be used to describe different types of networks as well. The TCP/IP model separates network configurations into five logical layers: physical layer, data link layer; network layer; transport layer; and application layer. These layers are well known in the art, and the following is merely a broad overview of each layer.
The physical layer includes the physical devices that form the underlying basis of the network, such as routers, switches, repeaters, network cables, network interface controllers (NICs), etc. The physical layer also includes low-level protocols for transmitting bits between the aforementioned physical devices.
The data link layer includes functionality for preparing packets for transmission (e.g., by adding transmission headers) and using the physical layer to transmit the packets. For example, dial-up modems often use Point-to-Point Protocol (PPP) at the data link layer, local area networks (LANs) often use Ethernet, and wireless LANs often use the Institute of Electrical and Electronics Engineers (IEEE) 802.11 standard. Many other data link layer protocols exist. The data link layer may be embedded in a NIC (e.g., in firmware or an integrated circuit within the NIC) or implemented in software (e.g., in a NIC device driver executing on a host operatively connected to the NIC).
The network layer includes addressing and routing functionality for moving packets from one device to another. For example, the IP suite (e.g., IPv4, IPv6, etc.), which includes functionality for routing packets from one specific IP address to another, belongs to the network layer. The network layer is most commonly implemented in software.
The transport layer manages flow control and connection states between devices. Some transport layer protocols are connection-oriented (e.g., TCP), while others are connectionless (e.g., User Datagram Protocol (UDP)). Each transport layer protocol is responsible for enforcing quality of service (QoS) parameters required by the protocol, such as data fragmentation, error correction, retry policy, traffic congestion control, etc. The transport layer is typically implemented in software.
The application layer includes protocols that may be used directly by applications, such as Hypertext Transport Protocol (HTTP), File Transport Protocol (FTP), Post Office Protocol version 3 (POP3), Teletype Network (TELNET), etc. These protocols are typically implemented in software.